import { RouteRecordRaw } from 'vue-router'
export const constantRoute: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      title: '登录',
    },
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/:catchAll(.*)',
    meta: {
      title: '404',
      closeTab: true,
    },
    component: () => import('@/views/error/index.vue'),
  },
]

export const asyncRoute: any[] = [
  {
    path: 'home',
    name: 'home',
    meta: {
      keepAlive: false,
      defaultMenu: false,
      title: '首页',
      icon: 'user',
      closeTab: true,
      visible: true,
    },
    component: 'views/home/index.vue',
    children: [],
  },
  {
    path: 'sys',
    name: 'sys',
    meta: {
      keepAlive: false,
      defaultMenu: false,
      title: '系统管理',
      icon: 'user',
      closeTab: false,
      visible: true,
    },
    component: 'views/systemAdmin/index.vue',
    redirect: '/layout/sys/user',
    children: [
      {
        path: 'user',
        name: 'user',
        meta: {
          keepAlive: true,
          defaultMenu: false,
          title: '用户管理',
          icon: 'user',
          closeTab: false,
          visible: true,
        },
        redirect: '',
        component: 'views/systemAdmin/user/index.vue',
      },
      {
        path: 'menu',
        name: 'menu',
        meta: {
          keepAlive: false,
          defaultMenu: false,
          title: '菜单管理',
          icon: 'user',
          closeTab: false,
          visible: true,
        },
        component: 'views/systemAdmin/menu/index.vue',
      },
      {
        path: 'role',
        name: 'role',
        meta: {
          keepAlive: false,
          defaultMenu: false,
          title: '角色管理',
          icon: 'user',
          closeTab: false,
          visible: true,
        },
        component: 'views/systemAdmin/role/index.vue',
      },
    ],
  },
  {
    path: 'about',
    name: 'about',
    meta: {
      keepAlive: false,
      defaultMenu: false,
      closeTab: false,
      title: '关于我们',
      icon: 'user',
      visible: true,
    },
    component: 'views/about/index.vue',
  },
  {
    path: 'personal',
    name: '个人主页',
    meta: {
      keepAlive: false,
      defaultMenu: false,
      title: '个人主页',
      closeTab: false,
      visible: true,
    },
    component: 'views/personalPage/index.vue',
  },
]
export const anyRoute: RouteRecordRaw[] = []
